3.386 \(\int \sqrt {\frac {-a+b x}{x^2}} \, dx\)

Optimal. Leaf size=53 \[ 2 x \sqrt {\frac {b}{x}-\frac {a}{x^2}}+2 \sqrt {a} \tan ^{-1}\left (\frac {\sqrt {a}}{x \sqrt {\frac {b}{x}-\frac {a}{x^2}}}\right ) \]

[Out]

2*arctan(a^(1/2)/x/(-a/x^2+b/x)^(1/2))*a^(1/2)+2*x*(-a/x^2+b/x)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {1979, 2007, 2013, 620, 203} \[ 2 x \sqrt {\frac {b}{x}-\frac {a}{x^2}}+2 \sqrt {a} \tan ^{-1}\left (\frac {\sqrt {a}}{x \sqrt {\frac {b}{x}-\frac {a}{x^2}}}\right ) \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[(-a + b*x)/x^2],x]

[Out]

2*Sqrt[-(a/x^2) + b/x]*x + 2*Sqrt[a]*ArcTan[Sqrt[a]/(Sqrt[-(a/x^2) + b/x]*x)]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 620

Int[1/Sqrt[(b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(1 - c*x^2), x], x, x/Sqrt[b*x + c*x^2
]], x] /; FreeQ[{b, c}, x]

Rule 1979

Int[(u_)^(p_), x_Symbol] :> Int[ExpandToSum[u, x]^p, x] /; FreeQ[p, x] && GeneralizedBinomialQ[u, x] &&  !Gene
ralizedBinomialMatchQ[u, x]

Rule 2007

Int[((a_.)*(x_)^(j_.) + (b_.)*(x_)^(n_.))^(p_), x_Symbol] :> Simp[(x*(a*x^j + b*x^n)^p)/(p*(n - j)), x] + Dist
[a, Int[x^j*(a*x^j + b*x^n)^(p - 1), x], x] /; FreeQ[{a, b, j, n}, x] && IGtQ[p + 1/2, 0] && NeQ[n, j] && EqQ[
Simplify[j*p + 1], 0]

Rule 2013

Int[(x_)^(m_.)*((a_.)*(x_)^(j_.) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[(a*x^Simplify[j/n]
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, j, m, n, p}, x] &&  !IntegerQ[p] && NeQ[n, j] && IntegerQ[Simplify[j
/n]] && EqQ[Simplify[m - n + 1], 0]

Rubi steps

\begin {align*} \int \sqrt {\frac {-a+b x}{x^2}} \, dx &=\int \sqrt {-\frac {a}{x^2}+\frac {b}{x}} \, dx\\ &=2 \sqrt {-\frac {a}{x^2}+\frac {b}{x}} x-a \int \frac {1}{\sqrt {-\frac {a}{x^2}+\frac {b}{x}} x^2} \, dx\\ &=2 \sqrt {-\frac {a}{x^2}+\frac {b}{x}} x+a \operatorname {Subst}\left (\int \frac {1}{\sqrt {b x-a x^2}} \, dx,x,\frac {1}{x}\right )\\ &=2 \sqrt {-\frac {a}{x^2}+\frac {b}{x}} x+(2 a) \operatorname {Subst}\left (\int \frac {1}{1+a x^2} \, dx,x,\frac {1}{\sqrt {-\frac {a}{x^2}+\frac {b}{x}} x}\right )\\ &=2 \sqrt {-\frac {a}{x^2}+\frac {b}{x}} x+2 \sqrt {a} \tan ^{-1}\left (\frac {\sqrt {a}}{\sqrt {-\frac {a}{x^2}+\frac {b}{x}} x}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 66, normalized size = 1.25 \[ \frac {2 x \sqrt {\frac {b x-a}{x^2}} \left (\sqrt {b x-a}-\sqrt {a} \tan ^{-1}\left (\frac {\sqrt {b x-a}}{\sqrt {a}}\right )\right )}{\sqrt {b x-a}} \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[(-a + b*x)/x^2],x]

[Out]

(2*x*Sqrt[(-a + b*x)/x^2]*(Sqrt[-a + b*x] - Sqrt[a]*ArcTan[Sqrt[-a + b*x]/Sqrt[a]]))/Sqrt[-a + b*x]

________________________________________________________________________________________

fricas [A]  time = 0.41, size = 98, normalized size = 1.85 \[ \left [2 \, x \sqrt {\frac {b x - a}{x^{2}}} + \sqrt {-a} \log \left (\frac {b x - 2 \, \sqrt {-a} x \sqrt {\frac {b x - a}{x^{2}}} - 2 \, a}{x}\right ), 2 \, x \sqrt {\frac {b x - a}{x^{2}}} - 2 \, \sqrt {a} \arctan \left (\frac {x \sqrt {\frac {b x - a}{x^{2}}}}{\sqrt {a}}\right )\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((b*x-a)/x^2)^(1/2),x, algorithm="fricas")

[Out]

[2*x*sqrt((b*x - a)/x^2) + sqrt(-a)*log((b*x - 2*sqrt(-a)*x*sqrt((b*x - a)/x^2) - 2*a)/x), 2*x*sqrt((b*x - a)/
x^2) - 2*sqrt(a)*arctan(x*sqrt((b*x - a)/x^2)/sqrt(a))]

________________________________________________________________________________________

giac [A]  time = 0.16, size = 61, normalized size = 1.15 \[ -2 \, \sqrt {a} \arctan \left (\frac {\sqrt {b x - a}}{\sqrt {a}}\right ) \mathrm {sgn}\relax (x) + 2 \, {\left (\sqrt {a} \arctan \left (\frac {\sqrt {-a}}{\sqrt {a}}\right ) - \sqrt {-a}\right )} \mathrm {sgn}\relax (x) + 2 \, \sqrt {b x - a} \mathrm {sgn}\relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((b*x-a)/x^2)^(1/2),x, algorithm="giac")

[Out]

-2*sqrt(a)*arctan(sqrt(b*x - a)/sqrt(a))*sgn(x) + 2*(sqrt(a)*arctan(sqrt(-a)/sqrt(a)) - sqrt(-a))*sgn(x) + 2*s
qrt(b*x - a)*sgn(x)

________________________________________________________________________________________

maple [A]  time = 0.08, size = 55, normalized size = 1.04 \[ \frac {2 \sqrt {\frac {b x -a}{x^{2}}}\, \left (-\sqrt {a}\, \arctan \left (\frac {\sqrt {b x -a}}{\sqrt {a}}\right )+\sqrt {b x -a}\right ) x}{\sqrt {b x -a}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((b*x-a)/x^2)^(1/2),x)

[Out]

2*((b*x-a)/x^2)^(1/2)*x*(-a^(1/2)*arctan((b*x-a)^(1/2)/a^(1/2))+(b*x-a)^(1/2))/(b*x-a)^(1/2)

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \sqrt {\frac {b x - a}{x^{2}}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((b*x-a)/x^2)^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt((b*x - a)/x^2), x)

________________________________________________________________________________________

mupad [B]  time = 5.18, size = 67, normalized size = 1.26 \[ 2\,x\,\sqrt {\frac {b}{x}-\frac {a}{x^2}}+\frac {2\,\sqrt {a}\,\sqrt {x}\,\mathrm {asin}\left (\frac {\sqrt {a}}{\sqrt {b}\,\sqrt {x}}\right )\,\sqrt {\frac {b}{x}-\frac {a}{x^2}}}{\sqrt {b}\,\sqrt {1-\frac {a}{b\,x}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-(a - b*x)/x^2)^(1/2),x)

[Out]

2*x*(b/x - a/x^2)^(1/2) + (2*a^(1/2)*x^(1/2)*asin(a^(1/2)/(b^(1/2)*x^(1/2)))*(b/x - a/x^2)^(1/2))/(b^(1/2)*(1
- a/(b*x))^(1/2))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \sqrt {\frac {- a + b x}{x^{2}}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((b*x-a)/x**2)**(1/2),x)

[Out]

Integral(sqrt((-a + b*x)/x**2), x)

________________________________________________________________________________________